#ifndef SPECTRUM_H_
#define SPECTRUM_H_

#include <vector>
#include <complex>
#include <QtCore/QString>

namespace spectClean {

class Spectrum
{
    public:
        Spectrum();
        ~Spectrum();

        typedef std::complex<double> Complex;

    public:
        /// Clear the time series data.
        void clear();

        /// Resize the time series.
        void resize(const unsigned n);

        /// Returns the number of entries in the spectrum.
        unsigned size() const { return _freq.size(); }

        void setStartFreq(const double value) { _startFreq = value; }
        double startFreq() const { return _startFreq; }

        void setFreqInc(const double value) { _freqInc = value; }
        double freqInc() const { return _freqInc; }

        std::vector<double> & freq() { return _freq; }
        const std::vector<double> & freq() const { return _freq; }

        std::vector<Complex> &  amp() { return _amp; }
        const std::vector<Complex> & amp() const { return _amp; }

    public:
        void save(const QString & filename) const;
        // TODO: load

    private:
        double _startFreq;
        double _freqInc;
        std::vector<double> _freq;
        std::vector<Complex> _amp;
};

} // namespace spectClean
#endif // SPECTRUM_H_
